export function isPt(pt) {
  if (pt instanceof Point3d) return true;
  return false;
}
// export function sortPt(a, b) {
//   if (!isPt(a) || !isPt(b)) return false;
//   if(a.x > b.x) return 
// }
export class Point3d {
  constructor(x, y, z = 0) {
    this.x = x;
    this.y = y;
    this.z = z;
  }
  plus(vec) {
    const newPt = new Point3d();
    newPt.x = this.x + vec.x;
    newPt.y = this.y + vec.y;
    return newPt;
  }
  minus(vec) {
    const newPt = new Point3d();
    newPt.x = this.x - vec.x;
    newPt.y = this.y - vec.y;
    return newPt;
  }
  toString(){
    return '(' + this.x + ', ' + this.y + ')';
  }
}